//								全局变量
//////////////////////////////////
//小车动画
	function car(){
		var i = 0;
		arr1 = ["url(img/22.png)","url(img/23.png)","url(img/24.png)","url(img/25.png)"];
		var	time1 =setInterval(function(){
			i++;
			if(i==4){
				i=0
			}
			$(".car").css("background-image",arr1[i]);
		},60)
	}
//复原
	function back(item){
		$(item).prev().css({
			"transform":"rotateY(0deg)"
		})
		$(item).css({
			"transform":"rotateY(-180deg)"
		})
	}
//翻牌
	function trueOver(item){
		$(item).prev().css({
			"transform":"rotateY(-180deg)"
		})
		$(item).css({
			"transform":"rotateY(0deg)"
		})
//		console.log("显示！")
	}
//缩小
	function scaleO(item){
		$(item).parent().css({
			"transtion":"500ms",
			"transform":"scale(0)"
		})
	}
//定义图片路径	
	var arr2
	arr2 =[ "img/11.png","img/11.png","img/12.png","img/12.png",
			"img/13.png","img/13.png","img/14.png","img/14.png",
			"img/15.png","img/15.png","img/16.png","img/16.png",
			"img/11.png","img/11.png","img/12.png","img/12.png",
			"img/13.png","img/13.png","img/14.png","img/14.png",]
	
	
	//生成20个最大值为20的随机数不同的随机数
	var str2 =[];
	for(var i=0;i<20;i++){
		var ran = Math.floor(Math.random()*20)
		if(str2.indexOf(ran)==-1){
			str2.push(ran)
		}else{
			i--
		}
	}
	//添加图片和路径
	function addSrc(num){
		for(var i=0;i<lent;i++){
			var img =$("<img>")
			img.prop("src",function(){
				return arr2[str2[i]]
			})
			img.addClass("img2")
			img.data("index",i)
			if(num == 1){
				if($(".tAll div").eq(i).children().length<2){
					img.appendTo($(".tAll div").eq(i))
				}
			}else if(num == 2){
				if($(".tAll2 div").eq(i).children().length<2){
					img.appendTo($(".tAll2 div").eq(i))
				}
			}
		}
	}
	var Check = 2 						//每次只能翻两次	
	var grade = 0;						//分数
	var lent = $(".tAll div").length;   //定义时候完成
	var overLent = lent/2;
	var arr3 = [];
	var arr4 = [];
	var time = $(".img img").css("transition-duration")
	var time2 = time.slice(0,time.length-1)*1000
//////////////////////////////////	

//进场动画
$(window).ready(function(){
	car()
	$(".ordinary").on("click",function(){ordinary()})
	$(".enhancedVersion").on("click",function(){enhancedVersion()})
})



	
	
	
	
